<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/auth/templates/template.xhtml">
	<ui:define name="pageTitle">Lista de Perfis de Usuários</ui:define>
	<ui:define name="body">
		<f:view>

			<p:growl id="messages" showDetail="true" autoUpdate="true"
				closable="true" />

			<h:form id="form">
				<h:panelGrid cellspacing="10px" styleClass="center">
					<f:facet name="header">Lista de Perfis de Usuários</f:facet>

					<ui:include src="/auth/usuario/painelsenha.xhtml" />

					<p:dataTable id="tabelaperfisusuario"
						rendered="#{usuarioVSBean.validUser}"
						value="#{usuarioVSBean.listaPerfisUsuarios}" var="perfil"
						emptyMessage="Não existem registros para esta tabela"
						paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="5,10,15">
						<p:column headerText="Usuário">
							<h:outputText value="#{perfil.nome}" />
						</p:column>
						<p:column headerText="Apelido">
							<h:outputText value="#{perfil.nick}" />
						</p:column>
						<p:column headerText="Remover">
							<p:commandButton action="#{usuarioVSBean.removerUsuario(perfil)}"
								icon="ui-icon-trash" title="Remover" update="@form :messages" />
						</p:column>
					</p:dataTable>

				</h:panelGrid>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>

</html>